package com.yihu.yihuds.service;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import com.yihu.dataService.hessian.resource.ResourceMongoDBManager;
import com.yihu.web.bean.RedPack;
import com.yihu.web.bean.UserBehavior;
import com.yihu.web.bean.ViewPointStatis;
import com.yihu.web.bean.user.Address;
import com.yihu.web.bean.user.Coupon;
import com.yihu.web.bean.user.User;
import com.yihu.web.bean.user.Wallet;
import com.yihu.web.bean.user.WechatLoginStat;
import com.yihu.web.bean.vo.AddressQuery;
import com.yihu.web.bean.vo.CouponQuery;
import com.yihu.web.bean.vo.CouponRebateQuery;
import com.yihu.web.bean.vo.CouponVO;
import com.yihu.web.bean.vo.QRCode;
import com.yihu.web.bean.vo.QrCodeQuery;
import com.yihu.web.bean.vo.RedpackQuery;
import com.yihu.web.bean.vo.RewardQuery;
import com.yihu.web.bean.vo.UserBehaviorQuery;
import com.yihu.web.bean.vo.UserPublishQuery;
import com.yihu.web.bean.vo.UsersQuery;
import com.yihu.web.bean.vo.ViewPointStatisQuery;
import com.yihu.web.bean.vo.WechatLoginStatQuery;
import com.yihu.web.constats.ResponseVO;
import com.yihu.web.dataService.hessian.interfaceService.UserHService;
/***
 * 调用yihuds 用户地址管理\优惠券管理
 * @author Aaron
 *
 */
public class YihuUserService {

	UserHService service =null;
	public YihuUserService(){
		try {
			service= (UserHService)ResourceMongoDBManager.getSingleton().getBeans("yihuUserHSC");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public Object addAddress(Address address){
		return service.addAddress(address);
	}
	
	public Object updateAddress(Address address){
		return service.updateAddress(address);
	}
	
	public Object getAllAddressByUser(AddressQuery query){
		return service.getAllAddressByUser(query);
	}
	public Object getAddress(Address address){
		return service.getAddress(address);
	}
	public Object checkTag(Address address){
		return service.checkTag(address);
	}
	public Object setDefaultAddress(Address address){
		return service.setDefaultAddress(address);
	}
	public Object deleteAddress(Address address){
		return service.deleteAddress(address);
	}
	public Object changeUserModel(User user){
		return service.changeUserModel(user);
	}
	public Object batchAddCoupons(Coupon coupon){
		return service.batchAddCoupons(coupon);
	}
	public Object wallet(Wallet wallet){
		return service.wallet(wallet);
	}
	public Object recharge(Coupon coupon){
		return service.recharge(coupon);
	}
	public Object reduce(Wallet wallet){
		return service.reduce(wallet);
	}
	public Object setNewuserCoupons(long userId){
		return service.setNewuserCoupons(userId);
	}
	public Object getCouponsPage(CouponQuery query){
		return service.getCouponsPage(query);
	}
	public Object getWalletByUserId(long userId){
		return service.getWalletByUserId(userId);
	}
	public Object updateUser(User user){
		return service.updateUser(user);
	}
	public Object receiveCoupon(CouponVO cvo){
		return service.receiveCoupon(cvo);
	}
	
	public Object addQrCodeOfCoupon(QRCode qrcode,byte[] datas){
		return service.addQrCodeOfCoupon(qrcode,datas);
	}
	public byte[] getQrcodeByGridfsid(String id){
		return service.getQrCodeByFileName(id);				
	}
	//qrcode manager
	public Object addQrCode(QRCode qrcode){
		return service.addQrCode(qrcode);
	}
	
	public Object deleteQrCode(String id){
		return service.deleteQrCode(id);
	}
	public Object updateQrCode(QRCode qrcode){
		return service.updateQrCode(qrcode);
	}
	public Object getQrCode(String id){
		return service.getQrCode(id);
	}
	public Object getQrCodes(QrCodeQuery query){
		return service.getQrCodes(query);
	}
	
	public Map<String, Object> getUserProfile(long userId){
		return service.getUserProfile(userId);
	}
	public List<String> getOpenidsByQuery(UserPublishQuery query){
		return service.getOpenidsByQuery(query);
	}
	public Object addPublishids(QRCode code){
		return service.addPublishids(code);
	}
	public Object getCouponRebateBy(CouponRebateQuery query){
		return service.getCouponRebateBy(query);
	}
	
	public Object rebateRecharge(User user){
		return service.rebateRecharge(user);
	}
	public Object deletePublishids(QRCode code){
		return service.deletePublishids(code);
	}
	
	/***
	 * 获取用户奖金
	 * @param userId
	 * @return
	 */
	public Object getRewardsOfUser(RewardQuery query){
		return service.getRewardsOfUser(query);
	}
	
	/***
	 * 检查所有用户奖金是否以到账
	 * @param userId
	 * @return
	 */
	public Object checkRewards(){
		return service.checkRewards();
	}
	public Object rechargeAcount(Wallet wallet){
		return service.rechargeAcount(wallet);
	}
	
	public Object addUserBehavior(UserBehavior ub){
		return service.addUserBehavior(ub);
	}
	public Object addViewStatis(ViewPointStatis vps){
		return service.addViewStatis(vps);
	}
	public Object listViewStatis(ViewPointStatisQuery aQuery){
		return service.listViewStatis(aQuery);
	}
	public Object getUserBehaviors(UserBehaviorQuery ub){
		return service.getUserBehaviors(ub);
	}
	public Object getTopBehavior(UserBehaviorQuery ub){
		return service.getTopBehavior(ub);
	}
	public Map<String, Object> getAllStat(UserBehaviorQuery ub){
		return service.getAllStat(ub);
	}
	public Object addWechatStatis(WechatLoginStat ub){
		return service.addWechatStatis(ub);
	}
	public Object updateWechatStatis(WechatLoginStat ub){
		return service.updateWechatStatis(ub);
	}
	public Object queryLoginstat(WechatLoginStatQuery ub){
		return service.queryLoginstat(ub);
	}
	public Object getFriendVisitByUser(UsersQuery query){
		return service.getFriendVisitByUser(query);
	}
	public Object getFriendOrderByUser(UsersQuery query){
		return service.getFriendOrderByUser(query);
	}
	
	public ResponseVO backRewards(String orderNo){
		return service.backReward(orderNo);
	}
	public ResponseVO withdrawCash(RedPack redPack){
		return service.withdrawCash(redPack);
	}
	public Wallet getWallet(long userId){
		return service.getWallet(userId);
	}
	public Object getRedpacks(RedpackQuery query){
		return service.getRedpacks(query);
	}
}
